package com.shuang.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shuang.service.DbGoodsFormatParamService;
@Controller
@RequestMapping("/formatParam")
public class DbGoodsFormatParamHanlder {
	
	@Resource(name="dbGoodsFormatParamService")
	private DbGoodsFormatParamService dbGoodsFormatParamService;
	
	@RequestMapping("/getFormatInfoById")
	@ResponseBody
	public Map<String,Object> getFormatInfoById(@RequestParam(value="id") Long gId){
		if(gId==null){
			Map<String,Object> map=new HashMap<String, Object>();
			map.put("sataus", 403);
			map.put("data", "参数不完整错误");
		}
		return dbGoodsFormatParamService.getFormatInfoById(gId);
	}
	@RequestMapping("/updateFormatInfoById")
	@ResponseBody
	public Map<String,Object > updateFormatInfoById(@RequestParam(value="id") Long gId,String formatParam){
		if(gId==null||formatParam==null||formatParam==""){
			Map<String,Object> map=new HashMap<String, Object>();
			map.put("sataus", 403);
			map.put("data", "参数不完整错误");
		}
		return dbGoodsFormatParamService.updateFormatInfoById(gId,formatParam);
	}
}
